package interfaces.clients.dispatcher.replies;

import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * @author Mihail A. Muhin
 */
public class GetFileReply extends BaseReply {
	private String contents = null;

	public String getContents() {
		return contents;
	}

	public GetFileReply(String contents) {
		this.contents = contents;
	}

	public void write(ObjectOutputStream oos) throws WriteCorrectableException {
		writeClassName(oos);
		try {
			oos.writeObject(contents);
		} catch (IOException e) {
			throw new WriteCorrectableException("Couldn't write reply to a user stream");
		}
	}
}
